<!doctype html>
<html lang="zh-CN">
<include file="Public:head" />

<body class="user-select">
<section class="container-fluid">
 <include file="Public:header" />
  <div class="row">
     <include file="Public:aside" />
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
      <form action="" method="post" >
        <h1 class="page-header">操作</h1>
        <form action="" method="post" class="navbar-form navbar-right" role="search">
            <div class="input-group">
              <input type="text" class="form-control" name="key" autocomplete="off" placeholder="键入关键字或订单id搜索" maxlength="15">
              <span class="input-group-btn">
              <button class="btn btn-default" type="submit">搜索</button>
              </span> </div>
          </form>
        <!-- <ol class="breadcrumb">
          <li><a href="addorder.html">增加订单</a></li>
        </ol> -->
        <h1 class="page-header">管理 <span class="badge">{$orderNum}</span></h1>
        <div class="table-responsive">
          <table class="table table-striped table-hover">
            <thead>
              <tr>
                <th><span class="glyphicon glyphicon-th-large"></span> <span class="visible-lg">订单id</span></th>
                <th><span class="glyphicon glyphicon-file"></span> <span class="visible-lg">描述</span></th>
                <th><span class="glyphicon glyphicon-list"></span> <span class="visible-lg">状态</span></th>
               <!-- <th class="hidden-sm"><span class="glyphicon glyphicon-tag"></span> <span class="visible-lg">标签</span></th>
               <th class="hidden-sm"><span class="glyphicon glyphicon-comment"></span> <span class="visible-lg">评论</span></th> -->
                <th><span class="glyphicon glyphicon-time"></span> <span class="visible-lg">日期</span></th>
                 <th><span class="glyphicon glyphicon-pencil"></span> <span class="visible-lg">审核日期</span></th>
              </tr>
            </thead>
            <tbody>
            <volist name="orders" id="vo">
              <tr>
                <td>{$vo.id}</td>
                <td class="order-title">{$vo.desc}</td>
                 <td><eq name="vo.paystatus" value="1">已审核付款<else/>未审核</eq></td>
                <!-- <td class="hidden-sm">PHP、JavaScript</td>
                <td class="hidden-sm">0</td> -->
                <td>{$vo.addtime|date="Y-m-d H:i:s",###}</td>
               <td><eq name="vo.paystatus" value="1">{$vo.audit_time|date="Y-m-d H:i:s",###}<else/>未审核</eq></td> 
              </tr>
            </volist>
            </tbody>
          </table>
        </div>
        <footer class="message_footer">

          <nav>
            <!-- <div class="btn-toolbar operation" role="toolbar">
              <div class="btn-group" role="group"> <a class="btn btn-default" onClick="select()">全选</a> <a class="btn btn-default" onClick="reverse()">反选</a> <a class="btn btn-default" onClick="noselect()">不选</a> </div>
              <div class="btn-group" role="group">
                <button type="submit" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="删除全部选中" name="checkbox_delete">删除</button>
              </div>
            </div> -->
             <ul class="pagination pagenav">
              <!-- <li class="disabled"><a aria-label="Previous"> <span aria-hidden="true">&laquo;</span> </a> </li>
              <li class="active"><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li><a href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> </a> </li> -->
              {$page}
            </ul> 
          </nav>
        </footer>
      </form>
    </div>
  </div>
</section>

<!-- 模态框 右键菜单-->
<include file="Public:modal" />
<!-- 模态框 右键菜单-->

<script>
//是否确认删除
$(function(){   
  $("#main table tbody tr td a").click(function(){
    var name = $(this);
    var id = name.attr("rel"); //对应id  
    if (event.srcElement.outerText == "删除") 
    {
      if(window.confirm("此操作不可逆，是否确认？"))
      {
        $.ajax({
          type: "POST",
          url: "/order/delete",
          data: "id=" + id,
          cache: false, //不缓存此页面   
          success: function (data) {
            window.location.reload();
          }
        });
      };
    };
  });   
});
</script>
</body>
</html>
